import VueRouter from 'vue-router' // 1.安装路由
// 2.引入各个vue组件
import MyLogin from '../components/MyLogin'
import MyRegedit from '../components/MyRegedit'
import HelloWorld from '../components/HelloWorld'
import MyMap from '../components/MyMap'
import MYAMAP from '../components/MYAMAP'
import MyMapDemo from '../components/MyMapDemo'
import MapTest from '../components/MapTest2'
import Vue from 'vue'
// import SiteConfig from '../components/SiteConfig'

// 3.使用VueRouter
// eslint-disable-next-line no-undef
Vue.use(VueRouter)
// 4.定义路由组，将相关页面都加载
const routes = [
  {path: '/MyLogin', name: MyLogin, component: MyLogin},
  {path: '/MyRegedit', name: MyRegedit, component: MyRegedit},
  {path: '/HelloWorld', name: HelloWorld, component: HelloWorld},
  {path: '/MyMap', name: MyMap, component: MyMap},
  {path: '/AMap', name: MYAMAP, component: MYAMAP},
  {path: '/MyMapDemo', name: MyMapDemo, component: MyMapDemo},
  {path: '/MapTest2', name: MapTest, component: MapTest},
  // {path: '/SiteConfig', name: SiteConfig, component: SiteConfig},
  {
    path: '/',
    redirect: 'AMap' // 重定向
  }
]
// 5.创建router对路由进行重定向
export default new VueRouter({
  mode: 'history',
  routes
})
